using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Orderhistory : IAccessible<T_Orderhistory, Orderhistory>, ILogicEntity<T_Orderhistory, Orderhistory>
    {
        public int ID { get; set; }

        public int OrderID { get; set; }

        public int PreState { get; set; }

        public int CurrentState { get; set; }

        public DateTime CreateTime { get; set; }

        public string Remark { get; set; }

        public string CreateUser { get; set; }

        protected override void Covariant(T_Orderhistory model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.OrderID = model.OrderID;
                    this.PreState = model.PreState;
                    this.CurrentState = model.CurrentState;
                    this.CreateTime = model.CreateTime;
                    this.Remark = model.Remark;
                    this.CreateUser = model.CreateUser;
            }
}
        protected override T_Orderhistory Inverter(Orderhistory model)
        {
            if (model != null)
            {
                return new T_Orderhistory()
                {
                    ID = model.ID,
                    OrderID = model.OrderID,
                    PreState = model.PreState,
                    CurrentState = model.CurrentState,
                    CreateTime = model.CreateTime,
                    Remark = model.Remark,
                    CreateUser = model.CreateUser,
                };
            }
            return null;
        }
        public Orderhistory Set(T_Orderhistory dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
